package com.example.togethermove.ui.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.fragment.app.Fragment;


import com.example.togethermove.R;
import com.example.togethermove.base.BaseFragment;
import com.example.togethermove.base.BaseTablayoutFragment;
import com.example.togethermove.bean.FragmentInfo;
import com.example.togethermove.ui.activity.competition.CompetitionCalendarActivity;
import com.example.togethermove.ui.activity.masterSportsman.NewsActivity;
import com.google.android.material.tabs.TabLayout;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import io.reactivex.annotations.Nullable;

/**
 * @ClassName: HomeFragment
 * @Author: csl
 * @Date
 * @Description:
 */
public class CompetitonFragment extends BaseFragment {

//    @BindView(R.id.tl_tabs)
//    TabLayout tlTabs;
    @BindView(R.id.im_competition_calendar)
    ImageView ivSearch;
//    @BindView(R.id.vp_list)
//    MyViewPager vpList;

    private boolean isFirst = true;
    public static CompetitonFragment instance;
    Unbinder unbinder;
    private List<Fragment> fragmentList;

//   private List<TitleTypeBean.QueryAllTagBO> titleList;
    public CompetitonFragment() {
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        super.onCreateView(inflater, container, savedInstanceState);
        View view = inflater.inflate(R.layout.fragment_competition, null);
        unbinder = ButterKnife.bind(this, view);

        instance = this;
        initData();

        return view;
    }

    @Override
    protected View getSuccessView() {
        return null;
    }

    @Override
    public Object requestData() {
        return null;
    }



    private void initData() {
//        TitleTagsDoc doc= new TitleTagsDoc();
//        doc.setAppType("1").setVersionCode(AppUtil.getAppVersionCode(getActivity()) + "").setVersionName(AppUtil.getAppVersionName(getActivity()))
//                .setChannelName(AppUtil.getChannelName1(getActivity()));;
//        HttpMethods.getInstance().getTitleTypes(doc).subscribe(new MyObserver<TitleTypeBean>() {
//            @Override
//            protected void onError(ApiException ex) {
//
//            }
//
//            @Override
//            public void onSubscribe(Disposable d) {
//
//            }
//
//            @Override
//            public void onNext(TitleTypeBean bean) {
//                titleList=bean.getTags();
//                init();
//            }
//
//            @Override
//            public void onComplete() {
//
//            }
//        });

    }


    /**
     * 设置tablayout选中状态
     *
     * @param     //TabLayout.Tab tab
     */
    private void setStatus(int persition) {
//        vpList.setCurrentItem(persition);
//        for (int i = 0; i < tlTabs.getTabCount(); i++) {
//            if (i == persition) {
//                ((TextView) tlTabs.getTabAt(i).getCustomView().findViewById(R.id.tv_title)).setTextColor(ContextCompat.getColor(mActivity, R.color.black_1A1A1A));
//                ((TextView) tlTabs.getTabAt(i).getCustomView().findViewById(R.id.tv_title)).setTextSize(22);
//                ((TextView) tlTabs.getTabAt(i).getCustomView().findViewById(R.id.tv_title)).getPaint().setFakeBoldText(true);
//            } else {
//                ((TextView) tlTabs.getTabAt(i).getCustomView().findViewById(R.id.tv_title)).setTextColor(ContextCompat.getColor(mActivity, R.color.black_666666));
//                ((TextView) tlTabs.getTabAt(i).getCustomView().findViewById(R.id.tv_title)).setTextSize(14);
//                ((TextView) tlTabs.getTabAt(i).getCustomView().findViewById(R.id.tv_title)).getPaint().setFakeBoldText(false);
//            }
//
//        }
    }
    @OnClick({R.id.im_competition_calendar})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.im_competition_calendar:

                break;
        }
    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }




    public void switchs(int pos) {
//        shotVideoHome();
    }

}
